//这里是用来处理博客前台的相关路由
const Router = require("koa-router");
const clientController = require("../controller/controller.client");
const {verifyUserLogin} = require("../middleware/verifyLogin");
const clientRouter = new Router();
//访问博客首页
clientRouter.get("/",clientController.viewIndex);
//访问指定类目的文章列表
clientRouter.get("/article/category/:id",clientController.getListByCategory);
//访问搜索关键词得到的文章列表
clientRouter.get("/article/search",clientController.getListBySearch);
//访问文章详情
clientRouter.get("/article/detail/:id",clientController.getDetail);
//访问登录页面
clientRouter.get("/login",clientController.viewLogin);
//访问注册页面
clientRouter.get("/register",clientController.viewRegister);
//注册功能实现
clientRouter.post("/register",clientController.registerUser);
//登录功能的实现
clientRouter.post("/login",clientController.login);
//退出功能的实现
clientRouter.get("/logout",clientController.logout);
module.exports = clientRouter;
